﻿<UserControl x:Class="Atlanchim.Crm.Mui.Pages.Home"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:lmondeilConverters="clr-namespace:Atlanchim.Crm.Mui.Pages.Societes"
             xmlns:CrmCommands="clr-namespace:Atlanchim.Crm.Mui"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="600">
    <Grid Style="{StaticResource ContentRoot}">
        <WrapPanel>

            <!--Sociétés-->
            <Button Padding="0" Margin="2"
                    Width="160" Height="80"
                    HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
                    Command="NavigationCommands.GoToPage" CommandParameter="/pages/Societes/PageListSocietes.xaml#TypeSociete=0">
                <Button.Content>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="3*"/>
                            <RowDefinition Height="2*"/>
                        </Grid.RowDefinitions>

                        <Rectangle Fill="{DynamicResource Accent}" Grid.Row="0" Grid.RowSpan="2"/>
                        <TextBlock Text="Clients" Foreground="White" Margin="2"/>

                        <Rectangle Fill="#3F000000" Grid.Row="1"/>
                        <TextBlock Text="{Binding Path=ClientsCount, FallbackValue=0}" Foreground="White" Grid.Row="1" Margin="2" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="30"/>
                    </Grid>
                </Button.Content>
            </Button>

            <!--Prospects-->
            <Button Padding="0" Margin="2"
                    Width="160" Height="80"
                    HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
                    Command="NavigationCommands.GoToPage" CommandParameter="/pages/Societes/PageListSocietes.xaml#TypeSociete=1">
                <Button.Content>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="3*"/>
                            <RowDefinition Height="2*"/>
                        </Grid.RowDefinitions>

                        <Rectangle Fill="{DynamicResource Accent}" Grid.Row="0" Grid.RowSpan="2"/>
                        <TextBlock Text="Prospects" Foreground="White" Margin="2"/>

                        <Rectangle Fill="#3F000000" Grid.Row="1"/>
                        <TextBlock Text="{Binding Path=ProspectsCount, FallbackValue=0}" Foreground="White" Grid.Row="1" Margin="2" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="30"/>
                    </Grid>
                </Button.Content>
            </Button>
            
            <!--Contacts-->
            <Button Padding="0" Margin="2"
                    Width="160" Height="80"
                    HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
                    Command="NavigationCommands.GoToPage" CommandParameter="/pages/Contacts/PageListAllContacts.xaml">
                <Button.Content>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="3*"/>
                            <RowDefinition Height="2*"/>
                        </Grid.RowDefinitions>

                        <Rectangle Fill="{DynamicResource Accent}" Grid.Row="0" Grid.RowSpan="2"/>
                        <TextBlock Text="Contacts" Foreground="White" Margin="2"/>

                        <Rectangle Fill="#3F000000" Grid.Row="1"/>
                        <TextBlock Text="{Binding Path=ContactsCount, FallbackValue=0}" Foreground="White" Grid.Row="1" Margin="2" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="30"/>
                    </Grid>
                </Button.Content>
            </Button>

            <!--Actions-->
            <Button Padding="0" Margin="2"
                    Width="160" Height="80"
                    HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
                    Command="NavigationCommands.GoToPage" CommandParameter="/pages/Actions/PageListAllActions.xaml">
                <Button.Content>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="3*"/>
                            <RowDefinition Height="2*"/>
                        </Grid.RowDefinitions>

                        <Rectangle Fill="{DynamicResource Accent}" Grid.Row="0" Grid.RowSpan="2"/>
                        <TextBlock Text="Actions" Foreground="White" Margin="2"/>

                        <Rectangle Fill="#3F000000" Grid.Row="1"/>
                        <TextBlock Text="{Binding Path=ActionsCount, FallbackValue=0}" Foreground="White" Grid.Row="1" Margin="2" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="30"/>
                    </Grid>
                </Button.Content>
            </Button>
            
            <!--Alertes-->
            <Button Padding="0" Margin="2"
                    Width="160" Height="80"
                    HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
                    Command="NavigationCommands.GoToPage" CommandParameter="/pages/Alertes/PageListAlertes.xaml">
                <Button.Content>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="3*"/>
                            <RowDefinition Height="2*"/>
                        </Grid.RowDefinitions>

                        <Rectangle Fill="{DynamicResource Accent}" Grid.Row="0" Grid.RowSpan="2"/>
                        <TextBlock Text="Alertes" Foreground="White" Margin="2"/>

                        <Rectangle Fill="#3F000000" Grid.Row="1"/>
                        <TextBlock Text="{Binding Path=AlertesCount, FallbackValue=0}" Foreground="White" Grid.Row="1" Margin="2" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="30"/>
                    </Grid>
                </Button.Content>
            </Button>

            <!--Alertes du jour-->
            <Button Padding="0" Margin="2"
                    Width="160" Height="80"
                    HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
                    Command="NavigationCommands.GoToPage" CommandParameter="/pages/Alertes/PageListAlertes.xaml#Mode=day">
                <Button.Content>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="3*"/>
                            <RowDefinition Height="2*"/>
                        </Grid.RowDefinitions>

                        <Rectangle Fill="{DynamicResource Accent}" Grid.Row="0" Grid.RowSpan="2"/>
                        <Path Margin="100,0,0,0" Width="45.9922" Height="40.6089" Canvas.Left="15.8333" Canvas.Top="15.8333" Stretch="Fill" Fill="White" Data="F1 M 31.6666,34.8334C 33.4155,34.8334 34.8332,36.2512 34.8332,38.0001C 34.8332,39.749 33.4155,41.1667 31.6666,41.1667L 25.3333,45.9167L 28.4999,38.0001C 28.4999,36.2512 29.9177,34.8334 31.6666,34.8334 Z M 49.8749,34.0418C 52.034,34.0418 62.8295,54.5531 61.7499,55.6326C 60.6704,56.7122 39.0795,56.7121 37.9999,55.6326C 36.9204,54.5531 47.7158,34.0418 49.8749,34.0418 Z M 49.8749,50.2349C 48.9806,50.2349 48.2556,50.9599 48.2556,51.8542C 48.2556,52.7485 48.9806,53.4735 49.8749,53.4735C 50.7692,53.4735 51.4942,52.7485 51.4942,51.8542C 51.4942,50.9599 50.7692,50.2349 49.8749,50.2349 Z M 48.2556,40.519L 48.7953,48.7595L 50.9544,48.7595L 51.4942,40.519L 48.2556,40.519 Z M 31.6667,53.8333C 22.9222,53.8333 15.8333,46.7445 15.8333,38C 15.8333,29.7899 22.0822,23.0393 30.0833,22.2449L 30.0833,20.5833L 25.3333,20.5833L 25.3333,15.8333L 38,15.8333L 38,20.5833L 33.25,20.5833L 33.25,22.2449C 36.4344,22.561 39.3413,23.8207 41.6871,25.7404L 42.8296,24.5979L 40.5904,22.3588L 43.9491,19L 50.6667,25.7175L 47.3079,29.0763L 45.0687,26.8371L 43.9263,27.9795C 45.1259,29.4455 46.0678,31.1305 46.6828,32.9654C 45.6627,33.9558 44.1025,36.2948 42.4702,39.0715L 41.9583,39.5834L 39.5833,39.5834L 39.5833,36.4167L 43.437,36.4167C 42.7319,31.1249 38.5418,26.9348 33.25,26.2297L 33.25,30.0834L 30.0833,30.0834L 30.0833,26.2297C 24.7915,26.9348 20.6013,31.1249 19.8963,36.4167L 23.75,36.4167L 23.75,39.5834L 19.8963,39.5834C 20.6013,44.8752 24.7915,49.0653 30.0833,49.7704L 30.0833,45.9167L 33.25,45.9167L 33.25,49.7704C 34.8142,49.562 36.2821,49.0491 37.5922,48.2932L 37.4459,48.6063L 35.0141,53.4788C 33.9351,53.7111 32.8151,53.8333 31.6667,53.8333 Z "/>
                        <TextBlock Text="Alertes du jour" Foreground="White" Margin="2"/>

                        <Rectangle Fill="#3F000000" Grid.Row="1"/>
                        <TextBlock Text="{Binding Path=DayAlertesCount, FallbackValue=0}" Foreground="White" Grid.Row="1" Margin="2" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="30"/>
                    </Grid>
                </Button.Content>
            </Button>

            <!--Alertes de la semaine-->
            <Button Padding="0" Margin="2"
                    Width="160" Height="80"
                    HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
                    Command="NavigationCommands.GoToPage" CommandParameter="/pages/Alertes/PageListAlertes.xaml#Mode=week">
                <Button.Content>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="3*"/>
                            <RowDefinition Height="2*"/>
                        </Grid.RowDefinitions>

                        <Rectangle Fill="{DynamicResource Accent}" Grid.Row="0" Grid.RowSpan="2"/>
                        <TextBlock Text="Alertes de la semaine" Foreground="White" Margin="2"/>

                        <Rectangle Fill="#3F000000" Grid.Row="1"/>
                        <TextBlock Text="{Binding Path=WeekAlertesCount, FallbackValue=0}" Foreground="White" Grid.Row="1" Margin="2" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="30"/>
                    </Grid>
                </Button.Content>
            </Button>
        </WrapPanel>
    </Grid>
</UserControl>
